<?php 

class Promotion extends CI_Model {

	function getPromotion()
	{
		$query = $this->db->get('promotion');
		return $query->result();
	}
	
	function getSelectedFor($id = 0)
	{
		$qr = $this->db->query('SELECT `promotion_id` FROM `shop-promotion-product` WHERE  product_id = '.$id);
		if($qr->num_rows)
		{
			return $qr->result();
		}
		else 
		{
			return 0;
			}
	}


}

?>